package top.heliming.youyou.item.dao;


import java.util.List;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.additional.idlist.SelectByIdListMapper;
import top.heliming.youyou.item.pojo.Category;

/**
 * description: //商品分类
 *
 * @author: heliming
 * @date:2019/05/26 下午 9:43
 */
public interface CategoryMapper extends tk.mybatis.mapper.common.Mapper<Category> ,
    SelectByIdListMapper<Category, Long> {
  /**
   * 根据品牌id查询商品分类
   * @param bid
   * @return
   */
  @Select("SELECT * FROM tb_category WHERE id IN (SELECT category_id FROM tb_category_brand WHERE brand_id = #{bid})")
  List<Category> queryByBrandId(Long bid);
}
